<template>
  <div>
    <el-dialog title="订单详情" :visible.sync="dialogVisible" width="30%" :before-close="closeDialog">
      <div class="order-detail">
        <div class="title">订单信息</div>
        <div class="row-wrapper">
          <div class="row">
            <ul>
              <li>订单号：{{ goodsItem.order_no }}</li>
              <li>店铺：{{ goodsItem.shop }}</li>
              <li>负责业务员：{{ goodsItem.clerk }}</li>
              <li class="pay">实付总金额：¥{{ goodsItem.payment }}</li>
            </ul>
          </div>
          <div class="row">
            <ul>
              <li>下单时间：{{ goodsItem.created_at }}</li>
            </ul>
          </div>
        </div>
      </div>
      <div class="goods-info">
        <div class="title">商品信息</div>
        <div v-for="(item, index) of goodsItem.commodity" :key="index" class="row-wrapper">
          <div class="row">
            <ul>
              <li>货号：{{ item.ietm_no }}</li>
              <li>成本价：{{ item.cost }}</li>
              <li> 市场价：{{ item.price }}</li>
              <li>属性：{{ item.spec_name }}</li>
              <li>数量：{{ item.number }}</li>
            </ul>
          </div>
        </div>
      </div>
    </el-dialog>
  </div>
</template>
<script>
export default {
  props: {
    dialogVisible: {
      type: Boolean,
      default: false
    },
    goodsItem: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
    }
  },
  methods: {
    closeDialog() {
      this.$emit('closeDialog')
    }
  }
}
</script>
<style lang="scss" scoped>
.el-dialog__wrapper /deep/ .el-dialog {
  min-width: 1100px;
  .el-dialog__body{
    padding-top: 0 !important;
  }
}
.el-dialog__wrapper /deep/ .el-dialog__close{
    position: absolute;
    top: -55px;
    font-size: 21px;
    line-height: 21px;
    padding: 2px;
    font-weight: bold;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    background-color: rgba(255, 255, 255, 1);
}
.order-detail, .goods-info{
  margin-top: 23px;
  .title {
    height: 26px;
    line-height: 26px;
    color: rgba(68, 68, 68, 1);
    font-size: 16px;
    text-align: center;
    font-family: Roboto;
    text-align: left;
    font-weight: bold;
  }
  .row-wrapper {
    background-color: rgba(250, 250, 250, 1);
    border: 1px solid rgba(235, 238, 245, 1);
    padding: 23px 38px;
    box-sizing: border-box;
    margin-top: 8px;
    .row {
      ul {
        display: flex;
        justify-content: space-between;
        li {
          flex-basis: 25%;
          line-height: 20px;
          color: rgba(102, 102, 102, 1);
          font-size: 14px;
          text-align: center;
          font-family: Roboto;
          list-style: none;
          text-align: left;
          &.pay{
            color: red;
          }
        }
      }
    }
  }
}
.goods-info{
  .row-wrapper{
    .row{
      ul{
        li{
          flex-basis: 16%;
        }
      }
    }
  }
}
</style>
